package com.sky.context;
//应该说这是一个threadLocal方法
public class BaseContext {
    //可以定义一个threadLocal的静态常量
    public static final ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(Long id) {
        threadLocal.set(id);
    }//id存到ThreadLocal也就是线程局部变量的存储空间中去

    public static Long getCurrentId() {
        return threadLocal.get();
    }

    public static void removeCurrentId() {
        threadLocal.remove();
    }

}
